﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Staff.aspx.cs" Inherits="www.Admin.Staff" %>

<%@ Register TagPrefix="cc1" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit, Version=1.0.10920.32919, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" %>
<%@ Import Namespace="www.Controllers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">

        function CheckAllEmp(checkbox) {
            var gridVwHeaderChckbox = document.getElementById("<%=grid_staff.ClientID %>");
            for (i = 1; i < gridVwHeaderChckbox.rows.length; i++) {
                gridVwHeaderChckbox.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = checkbox.checked;
            }
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="title">
        QUẢN LÝ NHÂN VIÊN
    </div>
    <div class="clear">
    </div>

    <div id="pnview" runat="server">
        <div class="frame">
            <div class="table">
                <img src="../Design/Icon/icon/add.png" class="control" />
                <asp:LinkButton ID="lbtinsert1" runat="server" OnClick="lbtinsert_Click">Thêm Mới</asp:LinkButton>
                <img src="../Design/Icon/icon/delete.png" class="control" />
                <asp:LinkButton ID="lbtdel1" runat="server" OnClick="lbtdel_Click">Xóa</asp:LinkButton>
                <img src="../Design/Icon/icon/refresh.png" class="control" />
                <asp:LinkButton ID="lbtrefresh1" runat="server" OnClick="lbtrefresh_Click">Làm Tươi</asp:LinkButton>
                <img src="../Design/Icon/icon/uplevel.png" class="control" />
                <a href="javascript:void(0);" onclick="window.history.go(-1);">Trở Lại</a>
            </div>
            <div>
                <asp:GridView ID="grid_staff" runat="server" AutoGenerateColumns="False" BackColor="White"
                    BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" Width="100%" AllowPaging="True"
                    PageSize="30" ShowHeaderWhenEmpty="True" OnRowCommand="grid_advertise_RowCommand" OnPageIndexChanging="grid_advertise_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <input id="chkselectall" type="checkbox" runat="server" onclick="CheckAllEmp(this);" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkselect" runat="server" />
                            </ItemTemplate>
                            <HeaderStyle Width="5%"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblid" runat="server" Text='<%#Eval("Id") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Họ Tên
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%#Eval("Name") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Hình Ảnh
                            </HeaderTemplate>
                            <ItemTemplate>
                                <img src='../<%#Eval("Image") %>' id="img_advertise" height="70" width="115" />
                            </ItemTemplate>
                            <HeaderStyle Width="15%"></HeaderStyle>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Ngày Sinh
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%#Convert.ToDateTime(Eval("Birthday")).ToShortDateString() %>
                            </ItemTemplate>
                            <HeaderStyle Width="10%"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Giới Tính
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%#Utilities.Gender(Convert.ToInt32(Eval("Gender"))) %>
                            </ItemTemplate>
                            <HeaderStyle Width="7%"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Trạng Thái
                            </HeaderTemplate>
                            <ItemTemplate>
                                <%#Utilities.Active(Convert.ToInt32(Eval("Active"))) %>
                            </ItemTemplate>
                            <HeaderStyle Width="10%"></HeaderStyle>
                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                Thao Tác
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="ibtedit" runat="server" CommandName="cmd_edit" CommandArgument='<%#Eval("Id") %>'
                                    ToolTip='Sửa' CssClass="business" ImageUrl="../Design/Icon/icon/edit.png" />
                                <asp:ImageButton ID="ibtdel" runat="server" CommandName="cmd_delete" CommandArgument='<%#Eval("Id") %>'
                                    ToolTip='Xóa' CssClass="business" ImageUrl="../Design/Icon/icon/delete.png" />
                                <asp:ImageButton ID="ibtactive" runat="server" CommandName="cmd_active" CommandArgument='<%#Eval("Id") %>'
                                    ToolTip='<%#Utilities.TooltipActive(Convert.ToInt32(Eval("active"))) %>' CssClass="business" ImageUrl="../Design/Icon/icon/stop1.png" />
                                <asp:LinkButton ID="lbtdetailnew" runat="server" CommandName="cmd_detail" CommandArgument='<%#Eval("Id") %>'
                                    ToolTip='Chi tiết'>Chi tiết</asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle Width="20%"></HeaderStyle>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                    <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                    <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                    <RowStyle BackColor="White" ForeColor="#003399" />
                    <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                    <SortedAscendingCellStyle BackColor="#EDF6F6" />
                    <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
                    <SortedDescendingCellStyle BackColor="#D6DFDF" />
                    <SortedDescendingHeaderStyle BackColor="#002876" />
                </asp:GridView>
            </div>
            <div class="table">
                <img src="../Design/Icon/icon/add.png" class="control" />
                <asp:LinkButton ID="lbtinsert2" runat="server" OnClick="lbtinsert_Click">Thêm Mới</asp:LinkButton>
                <img src="../Design/Icon/icon/delete.png" class="control" />
                <asp:LinkButton ID="lbtdel2" runat="server" OnClick="lbtdel_Click">Xóa</asp:LinkButton>
                <img src="../Design/Icon/icon/refresh.png" class="control" />
                <asp:LinkButton ID="lbtrefress2" runat="server" OnClick="lbtrefresh_Click">Làm Tươi</asp:LinkButton>
                <img src="../Design/Icon/icon/uplevel.png" class="control" />
                <a href="javascript:void(0);" onclick="window.history.go(-1);">Trở Lại</a>
            </div>
        </div>
    </div>

    <div id="pncontrol" runat="server" visible="false">
        <div class="table">
            <img src="../Design/Icon/icon/page_save.png" class="control" />
            <asp:LinkButton ID="lbtsave1" runat="server" OnClick="lbtsave_Click">Lưu</asp:LinkButton>
            <img src="../Design/Icon/icon/moi.gif" class="control" />
            <asp:LinkButton ID="lbtdonew1" runat="server" OnClick="lbtdonew_Click">Làm Mới</asp:LinkButton>
            <img src="../Design/Icon/icon/back.png" class="control" />
            <asp:LinkButton ID="lbtback1" runat="server" OnClick="lbtback_Click">Trở Lại</asp:LinkButton>
        </div>
        <div class="frame">
            <fieldset style="width: 99%;">
                <legend>Thông tin nhân viên</legend>
                <div class="content">
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Họ tên:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" id="txtname" class="textbox" runat="server" />
                            &nbsp;
                        </div>

                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Ngày sinh:</span>
                        </div>
                        <div class="ColRight">
                            <asp:TextBox ID="txtbirthday" CssClass="textbox" runat="server"></asp:TextBox>
                            <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtbirthday"
                                Format="MM/dd/yyyy" Enabled="True">
                            </cc1:CalendarExtender>
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Giới tính:</span>
                        </div>
                        <div class="ColRight">
                            <asp:DropDownList ID="ddlgender" CssClass="combobox" runat="server">
                                <asp:ListItem Value="1">Nam</asp:ListItem>
                                <asp:ListItem Value="0">Nữ</asp:ListItem>
                            </asp:DropDownList>
                        </div>


                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Hình ảnh:</span>
                        </div>
                        <div class="ColRight">
                            <div class="uploadimageleft">
                                <input type="file" class="textbox" runat="server" id="fustaff" />
                                &nbsp;
                            </div>
                            <div class="uploadimageright">
                                <img id="img_upload" runat="server" />
                                &nbsp;
                            </div>
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>CMND:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txtidentification" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Số ĐT:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txttel" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Trình độ:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txtdegree" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Chức vụ:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txtministry" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Hệ số lương:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txtsalaryratio" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Lương cơ bản:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txtsalary" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Phụ cấp:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txtallowance" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Quê quán:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txthometown" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Ngày vào làm:</span>
                        </div>
                        <div class="ColRight">
                            <asp:TextBox ID="txtdatebegin" CssClass="textbox" runat="server"></asp:TextBox>
                            <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtdatebegin"
                                Format="MM/dd/yyyy" Enabled="True">
                            </cc1:CalendarExtender>
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Ngày kết thúc:</span>
                        </div>
                        <div class="ColRight">
                            <asp:TextBox ID="txtdateend" CssClass="textbox" runat="server"></asp:TextBox>
                            <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtdateend"
                                Format="MM/dd/yyyy" Enabled="True">
                            </cc1:CalendarExtender>
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Email:</span>
                        </div>
                        <div class="ColRight">
                            <input type="text" class="textbox" runat="server" id="txtemail" />
                        </div>
                    </div>
                    <div class="rows">
                        <div class="ColLeft">
                            <span>Trạng thái:</span>
                        </div>
                        <div class="ColRight">
                            <input type="checkbox" id="chkactive" runat="server" />
                        </div>
                    </div>
                    <fieldset style="width: 99%;">
                        <legend>Thông tin đăng nhập</legend>
                        <div class="content">
                            <div class="rows">
                                <div class="ColLeft">
                                    <span>Tên đăng nhập:</span>
                                </div>
                                <div class="ColRight">
                                    <input type="text" class="textbox" runat="server" id="txtusername" />
                                </div>
                            </div>
                            <div class="rows">
                                <div class="ColLeft">
                                    <span>Mật khẩu:</span>
                                </div>
                                <div class="ColRight">
                                    <input type="password" class="textbox" runat="server" id="txtpassword" />
                                </div>
                            </div>
                            <div class="rows">
                                <div class="ColLeft">
                                    <span>Nhập lại mật khẩu:</span>
                                </div>
                                <div class="ColRight">
                                    <input type="password" class="textbox" runat="server" id="txtrepassword" />
                                </div>
                            </div>
                            <div class="rows">
                                <div class="ColLeft">
                                    <span>Quyền hạn:</span>
                                </div>
                                <div class="ColRight">
                                    <select id="ddlRole" class="combobox" runat="server">
                                        <option value="3">Staff</option>
                                        <option value="2">Admin 2</option>
                                        <option value="1">Admin</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                </div>
            </fieldset>

        </div>
        <div class="table">
            <img src="../Design/Icon/icon/page_save.png" class="control" />
            <asp:LinkButton ID="lbtsave2" runat="server" OnClick="lbtsave_Click">Lưu</asp:LinkButton>
            <img src="../Design/Icon/icon/moi.gif" class="control" />
            <asp:LinkButton ID="lbtdonew2" runat="server" OnClick="lbtdonew_Click">Làm Mới</asp:LinkButton>
            <img src="../Design/Icon/icon/back.png" class="control" />
            <asp:LinkButton ID="lbtback2" runat="server" OnClick="lbtback_Click">Trở Lại</asp:LinkButton>
        </div>
    </div>
    <div id="pndetaistaff" runat="server" visible="false">
        <div class="table">
            <img src="../Design/Icon/icon/back.png" class="control" />
            <asp:LinkButton ID="lbtback3" runat="server" OnClick="lbtback_Click">Trở Lại</asp:LinkButton>
        </div>

        <div class="frame">
            <asp:FormView ID="frvstaff" runat="server" BackColor="White" BorderColor="#3366CC"
                BorderStyle="None" BorderWidth="0px" CellPadding="4" GridLines="Both" Width="99%">
                <ItemTemplate>
                    <div class="ColLeft">
                        <img src='../<%# Eval("Image") %>' id="imgstaff" />
                    </div>
                    <div class="ColRight">
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Họ Tên:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Name") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Ngày Sinh:</span>
                            </div>
                            <div class="ColRight">
                                <%# Convert.ToDateTime(Eval("Birthday")).ToShortDateString() %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Giới Tính:</span>
                            </div>
                            <div class="ColRight">
                                <%#Utilities.Gender(Convert.ToInt32(Eval("Gender"))) %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>CMND:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Identification") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Trình Độ:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Degree") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Chức Vụ:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Ministry") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Hệ Số Lương:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Salaryratio") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Lương Cơ Bản:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Salary") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Phụ Cấp:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Allowance") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Quê Quán:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Hometown") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Email:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Email") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Số ĐT:</span>
                            </div>
                            <div class="ColRight">
                                <%#Eval("Tel") %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Ngày Vào Làm:</span>
                            </div>
                            <div class="ColRight">
                                <%# Convert.ToDateTime(Eval("Datebegin")).ToShortDateString() %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Ngày Kết Thúc:</span>
                            </div>
                            <div class="ColRight">
                                <%# Convert.ToDateTime(Eval("Dateend")).ToShortDateString() %>
                            </div>
                        </div>
                        <div class="rows">
                            <div class="ColLeft">
                                <span>Trạng Thái:</span>
                            </div>
                            <div class="ColRight">
                                <%#Utilities.Active(Convert.ToInt32(Eval("Active"))) %>
                            </div>
                        </div>
                    </div>
                </ItemTemplate>
            </asp:FormView>
        </div>
        <div class="table">
            <img src="../Design/Icon/icon/back.png" class="control" />
            <asp:LinkButton ID="lbtback4" runat="server" OnClick="lbtback_Click">Trở Lại</asp:LinkButton>
        </div>
    </div>
</asp:Content>
